package javaBase.chapter02;

public class judgingLeapYears {
    public static void main(String[] args) {
        int year = 2020;
        boolean isLeapYear = isLeapYear(year);
        if (isLeapYear) {
            System.out.println(year + "是闰年");
        } else {
            System.out.println(year + "不是闰年");
        }
    }

    public static boolean isLeapYear(int year) {
        if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {
            return true;
        } else {
            return false;
        }
    }
}
